solaris 系統(tǒng)提供了非常豐富的聯(lián)機幫助.這些幫助主要以兩種形式存在,一種是命令的參考手冊頁(reference manual pages,也即我們常說的man page),另外一種是answer book,是sun公司的資料的電子版。
使用solaris聯(lián)機幫助的方法:
a. 使用reference manual page
在命令行上使用man命令:
如:$ man ls <enter>
b. 使用answer book
在命令行上使用answerbook命令
如:$ answerbook <enter>
2. man page的組織
unix的man page是按照節(jié)(section)來組織的.當我們使用man ls的時候,會看到ls(1),這個括號中的1就表示ls的man page位于section 1。
section通常是由一個主section名和一個可選的次section名組成.主section名通常是一個數(shù)字,次section名通常是一個或多個字母組成.
solaris中各 section 所對應的內容:
1: user commands and utilities
2: system calls
3: c library functions
4: file formats
5: headers,tables and macros
6: games and demos
7: device and network interfaces
8: maintance and accounting commands
9: device driver interfaces
3.man page的存放位置
a.系統(tǒng)本身的 man page存放在/usr/share/man/man*目錄中, /usr/man 是/usr/share/man的一個軟鏈接.
注:在安裝操作系統(tǒng)時,man page是可選安裝。如果未安裝,可將其它機器上的/usr/share/man目錄 mount 到本機上。或使用安裝光盤將相應的package裝上。
b.很多應用軟件有自己的man page.它們的缺省的安裝目錄通常是/usr/local/man/man*.通?梢酝ㄟ^修改該軟件的配置文件來指定新的安裝目錄(只需設置到/some/directory/man 這一層)
4.設置 man page的搜索路徑
當使用man命令查看某個命令或文件的幫助時,man要根據(jù)系統(tǒng)的環(huán)境變量manpath的值來確定搜索的路徑。當manpath變量未設置時,man 命令缺省查找/usr/share/man目錄。
manpath的格式:
manpath=dir1:dir2:dir3:...dirn; export manpath
設置manpath的方法
(1).臨時性修改manpath
在命令行上輸入以下命令:
$ manpath=$manpath:///man<enter>
$ export manpath<enter>
(2).永久性修改manpath
在用戶自己的 .profile文件中加入上述兩行內容
5.man 命令的高級使用技巧
a.使用 -s 選項明確指定man page的section 號
如:$ man -s 4 passwd<enter>
-s 選項非常有用。因為man的搜索順序是根據(jù)man.cf中的設置來進行的。當man找到一個匹配時,就不再往下找了。所以當你想查看一下/etc/passwd文件的格式而不是想了解passwd命令的使用時,光使用man passwd 你永遠達不到目的。這時使用man -s 4 passwd,強制man只搜索section 4中的文件。
b.使用 -f 選項列出某個命令的全部man page 的一行性摘要
該用法等同于 whatis 命令注:使用該選項或whatis命令時,要用到man的 windex數(shù)據(jù)庫。如果沒有windex文件,可以使用catman -w 來創(chuàng)建該文件。
如:$ whatis ls<enter>
ls ls (1) - list contents of directory
ls ls (1b) - list the contents of a directory
c.使用 -k 選項列出一行性摘要中含有給定關鍵字的所有命令
該用法等同于 apropos 命令
如:$ apropos shadow<enter>
lckpwdf lckpwdf (3c) - manipulate shadow password database lock file
putspent putspent (3c) - write shadow password file entry
pwconv pwconv (1m) - installs and updates /etc/shadow with information from /etc/passwd
shadow shadow (4) - shadow password file
ulckpwdf lckpwdf (3c) - manipulate shadow password database lock file
d.使用 -d 選項查看man 命令的工作過程
6. 使用 answer book
answer book在solaris系統(tǒng)中是作為一個package而組織的,它也是系統(tǒng)的可選安裝.
使用answer book的方法
$ answerbook <enter>
* 如何使用裝在其它機器上的 answer book?
例如:liszt 上的用戶要使用public主機上的answerbook
step 1: 在 public 上執(zhí)行以下命令:
$ display=liszt:0.0 ; export display <enter>
step 2: 在 liszt 上執(zhí)行以下命令:
$ xhost public <enter>
step 3: 在 public 上執(zhí)行answerbook 命令
$ answerbook <enter>